home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13172 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: solon.com!not-for-mail
  2. From: chuckh@ix.netcom.com (Chuck Hamilton)
  3. Newsgroups: comp.lang.c,comp.lang.c.moderated,hp.unix,comp.sys.hp.apps,comp.sys.hp.hpux
  4. Subject: Re: C coding problem
  5. Date: 4 Apr 1996 18:37:22 -0600
  6. Organization: Mercy Health Plan
  7. Sender: clc@solutions.solon.com
  8. Approved: clc@solutions.solon.com
  9. Message-ID: <4k1q02$57m@solutions.solon.com>
  10. References: <4ianbf$h86@solutions.solon.com> <4iemcl$a05@solutions.solon.com> <4io1io$no4@solutions.solon.com> <4j06na$808@solutions.solon.com> <4jttan$3gf@solutions.solon.com> <4jv6st$crf@solutions.solon.com>
  11. NNTP-Posting-Host: solutions.solon.com
  12. X-NETCOM-Date: Thu Apr 04  6:43:56 AM PST 1996
  13. X-Newsreader: Forte Agent .99d/16.182
  14.  
  15. schwarz@mips.complang.tuwien.ac.at (Konrad Schwarz) wrote:
  16.  
  17. >|> a[i] is converted to *(a + i) by the compiler in any case so
  18. >|> whats the advantage with your approach?
  19. >
  20. >The machine doesn't have to add, the machine doesn't have to multiply,
  21. >*a is less complicated to understand than a [i] since only one variable
  22. >is involved, *a is more type safe than a [i], since there is nothing
  23. >constraining i (besides it being of integral type), the optimizer
  24. >has less to do, compile time decreases, etc. 
  25. >
  26. >Why use C if you're uncomfortable with pointer arithmetic?  Why use
  27. >functional languages if you're uncomfortable with recursion?  Why use
  28. >object-oriented languages if you're uncomfortable with objects?
  29. >
  30. >Konrad Schwarz
  31.  
  32. Why not use i[a] and _really_ confuse the hell out of 'em?
  33. <smile>
  34.  
  35. I've been following this thread for a few days and just had to say
  36. something. Personally I agree with you. The language is well defined.
  37. If a programmer can't understand it's rules and constructs he should
  38. be programming in another language. And if he doesn't understand the
  39. relationships between pointers and arrays he most certainly shouldn't
  40. be programming in C. That _is_ the strength of the language.
  41. --
  42. Chuck Hamilton
  43. chuckh@ix.netcom.com
  44.  
  45. If at first you don't succeed, skydiving isn't for you.
  46.